
$('#search-btn').click(function(){
	$.ajax({
		type:"get",
		url:"http://www.duoweish.com/apis/DwCstmQuickSearch/",
		async:true,
		data:{
			CstmName:$('.sidebar-form').find('input[type=text]').val()
		},
		success:function(data){
			if(data=='failure'){
				layer.msg('查找失败')
			}else{
				layer.open({
	     						   type: 2
							        ,title: false
							        ,anim:4
							        ,closeBtn: 1
							        ,area:['100%','100%']
							        ,shade: 0
							        ,id: 'LAY_layuipro' 
							        ,shadeClose:true
							        ,btnAlign: 'c'
							        ,moveType: 1 
							        ,content:'http://www.duoweish.com/crm/user_infor.html?Id_data='+data
							 })
			}
		}
	});
})
$('.sidebar-form').find('input[type=text]').focus(function(){
	$(document).keydown(function (event) {
			    if ( event.keyCode == 13) {
			    	$.ajax({
						type:"get",
						url:"http://www.duoweish.com/apis/DwCstmQuickSearch/",
						async:true,
						data:{
							CstmName:$('.sidebar-form').find('input[type=text]').val()
						},
						success:function(data){
							if(data=='failure'){
								layer.msg('查找失败')
							}else{
								layer.open({
					     						   type: 2
											        ,title: false
											        ,anim:4
											        ,closeBtn: 1
											        ,area:['100%','100%']
											        ,shade: 0
											        ,id: 'LAY_layuipro' 
											        ,shadeClose:true
											        ,btnAlign: 'c'
											        ,moveType: 1 
											        ,content:'http://www.duoweish.com/crm/user_infor.html?Id_data='+data
											 })
							}
						}
					});
			    };
			    
			});
	})
$('.change_password').click(function(){
							layer.open({
					     						   type: 2
											        ,title: false
											        ,anim:1
											        ,closeBtn: 1
											        ,area:['400px','300px']
											        ,shade: 0
											        ,id: 'LAY_layuipro' 
											        ,shadeClose:true
											        ,shade:0.6
											        ,btnAlign: 'c'
											        ,moveType: 1 
											        ,content:'http://www.duoweish.com/crm/change_password.html'
											 })
})
